package org.example.musicserver.controller;

import jakarta.annotation.Resource;
import org.example.musicserver.common.Result;
import org.example.musicserver.service.PlayListCommentService;
import org.springframework.web.bind.annotation.*;

@RestController
public class PlayListCommentController {
    @Resource
    private PlayListCommentService playListCommentService;
    //返回指定歌单的评论
    @GetMapping("/playListComment/detail")
    public Result getPlayListCommentByPlayListId(@RequestParam Integer playListId,@RequestParam Byte type) {
        return Result.success("获取评论成功",playListCommentService.commentOfPlayListId( playListId, type));
    }
    //返回所有歌单的评论
    @GetMapping("/playListAllComment/detail")
    public Result getAllPlayListComment(@RequestParam Byte type,@RequestParam(required = false) String query) {
        return playListCommentService.commentOfAllPlayList(type,query);
    }
    //添加评论
    @PostMapping("/comment/add")
    public Result addSongCollection(@RequestParam Integer userId, @RequestParam Integer playListId,@RequestParam String content,@RequestParam Byte type) {
        return playListCommentService.addPlayListComment(userId,playListId,content, type);
    }
    //删除评论
    @DeleteMapping("/comment/delete")
    public Result deleteSongCollection(@RequestParam Integer id, @RequestParam Byte type) {
        return playListCommentService.deletePlayListComment(id, type);
    }
    //点赞评论
}
